import * as actions from '../../actions';
import {StoreState} from '../../types';
import {bindActionCreators, Dispatch} from 'redux'
import {connect} from 'react-redux';
import AlertBox from '../../components/AlertBox'

interface DispatchProps {
    closeAlert: Function;
}

const mapStateToProps = ({alertState, msg}: StoreState) => {
    return {
        alertState,
        msg
    }
}

const mapDispatchToProps = (dispatch: any):DispatchProps => ({
        closeAlert: () => dispatch(actions.closeAlert())
});

export default connect(
    mapStateToProps,
    mapDispatchToProps
)(AlertBox as any)